var mychart2 = echarts.init(document.getElementById("bar-chart"));
option = {
    title : {
        text: '考勤统计',
        textStyle:{
            fontSize: 14,
            fontWeight: 'normal',
            color: '#000',
            fontFamily:'微软雅黑'
        }
    },
    legend: {
        data:['全员','出勤','出差','请假']
    },
    tooltip : {
        trigger: 'axis',
        axisPointer : {
            show:false,            // 坐标轴指示器，坐标轴触发有效
            type : 'line'        // 默认为直线，可选为：'line' | 'shadow'
        }

    },
        toolbox: {
     show : true,
     feature : {
     mark : {show: true},
     dataView : {show: true, readOnly: false},
     restore : {show: true},
     saveAsImage : {show: true}
     }
     },
    calculable : true,
    xAxis : [
        {
            show:false,
            type : 'category',
            data : ['全员','出勤','出差','请假']
        }
    ],
    yAxis : [
        {
            show:false,
            type : 'value',
            boundaryGap: false
        }
    ],
    series : [
        {
            // name:'Acutal',
            type:'bar',
            //和
            stack: 'sum',
            barCategoryGap: '50%',
            itemStyle: {
                normal: {
                    color: function(params) {
                        // 颜色数组
                        /*   var colorList = [
                         '#C1232B','#B5C334','#FCCE10','#E87C25','#27727B',
                         '#FE8463','#9BCA63','#FAD860','#F3A43B','#60C0DD',
                         '#D7504B','#C6E579','#F4E001','#F0805A','#26C0C0'
                         ];*/
                        var colorList = [
                            '#9BCA63','#F4E001','#F0805A','#26C0C0'
                        ];
                        return colorList[params.dataIndex]
                    },
                    barBorderRadius:3,
                    label : {
                        show: true, position: 'insideTop'
                    }
                }
            },
//                data : ['全员（人）','出勤（人）','出差（人）','请假（人）']
            data:[100, 14, 12, 2]
        },
        {
            // name:'全员（人）',
            type:'bar',
            stack: 'sum',
            itemStyle: {
                normal: {
                    color: '#e6e6e6',
                    label : {
                        show: true,
                        position: 'top',
                        formatter: function (params) {
                            for (var i = 0, l = option.xAxis[0].data.length; i < l; i++) {
                                if (option.xAxis[0].data[i] == params.name) {
                                    return option.series[0].data[i] + params.value;
                                }
                            }
                        },
                        textStyle: {
                            color: '#F0805A'
                        }
                    }
                }
            },
            data:[0, 86,88,98]
        }
    ]
};



mychart2.setOption(option);